import request from '@/utils/request'

// 查询备品备件货品分类列表
export function listTypes(query) {
  return request({
    url: '/sparepart/types/list',
    method: 'get',
    params: query
  })
}
// 查询分类列表（排除节点）
export function listTypeExcludeChild(typeId) {
  return request({
    url: '/sparepart/types/list/exclude/' + typeId,
    method: 'get'
  })
}
// 查询备品备件货品分类详细
export function getTypes(typeId) {
  return request({
    url: '/sparepart/types/' + typeId,
    method: 'get'
  })
}

// 新增备品备件货品分类
export function addTypes(data) {
  return request({
    url: '/sparepart/types',
    method: 'post',
    data: data
  })
}

// 修改备品备件货品分类
export function updateTypes(data) {
  return request({
    url: '/sparepart/types',
    method: 'put',
    data: data
  })
}

// 删除备品备件货品分类
export function delTypes(typeId) {
  return request({
    url: '/sparepart/types/' + typeId,
    method: 'delete'
  })
}

// 导出备品备件货品分类
export function exportTypes(query) {
  return request({
    url: '/sparepart/types/export',
    method: 'get',
    params: query
  })
}
